n=int(input())
m=int(input())

a=[i for i in range(1,n+1)]

for i in range(0,m):
    index,move=map(int,input().split())
    j=0
    for k in range(0,n):
        if a[k]==index:
            j=k
            break
    item=a.pop(j)
    j+=move
    a.insert(j,item)

for item in a:
    print(item,end=" ")
print("")
